<?php $this->registerJsFile('@web/js/laydate.js',['depends'=>['app\assets\AppAsset']]) ?>
<?php $this->registerJsFile('@web/js/publish.js',['depends'=>['app\assets\AppAsset']]) ?>
<?php $this->registerCssFile('@web/css/publish.css',['depends'=>['app\assets\AppAsset']]) ?>
<?php
use yii\helpers;
use \yii\helpers\Url;
use \yii\helpers\HtmlPurifier;
use yii\widgets\ActiveForm;
?>
<script>
    var mes=<?=$mes ?>;
</script>
<div class="lost-publish-wrap">
    <h2>发布招领启示</h2>
    <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']])?>
        <div class="form-group clearfix">
            <label for="thing-img" class="col-xs-3 control-label">物品图片</label>
            <div class="col-xs-9">
                <input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
                <?= $form->field($model,"file")->fileInput() ?>
            </div>
        </div>
        <div class="form-group clearfix input-necessary">
            <label for="thing-name" class="col-xs-3 control-label">物品名称</label>
            <div class="col-xs-9">
                <input type="text" name="tname" id="thing-name" class="form-control" placeholder="物品名称">
            </div>
        </div>
        <div class="form-group clearfix">
            <label for="thing-type" class="col-xs-3 control-label">物品类别</label>
            <div class="col-xs-9">
                <select name="ttype" id="thing-type" class="form-control">
                    <?php foreach($types as $key => $value){ ?>
                    	<option><?=$value["name"] ?></option>
                    <?php }?>
                </select>
            </div>
        </div>
        <div class="form-group clearfix">
            <label for="thing-belong" class="col-xs-3 control-label">物品所属学院</label>
            <div class="col-xs-9">
                <select name="tbelong" id="thing-belong" class="form-control">
                    <?php foreach($ai as $key => $value){ ?>
                    	<option><?=$value["name"] ?></option>
                    <?php }?>
                </select>
            </div>
        </div>
        <div class="form-group clearfix input-necessary">
            <label for="thing-date" class="col-xs-3 control-label">丢失日期</label>
            <div class="col-xs-9">
                <input type="text" name="tdate" id="thing-date" class="form-control" placeholder="丢失日期" readonly onclick="laydate()">
            </div>
        </div>
        <div class="form-group clearfix input-necessary">
            <label for="thing-place" class="col-xs-3 control-label">丢失地点</label>
            <div class="col-xs-9">
                <input type="text" name="tplace" id="thing-place" class="form-control" placeholder="丢失地点">
            </div>
        </div>
        <div class="form-group clearfix">
            <label for="thing-return" class="col-xs-3 control-label">悬赏</label>
            <div class="col-xs-9">
                <input type="text" name="treturn" id="thing-return" class="form-control" placeholder="悬赏">
            </div>
        </div>
        <div class="form-group clearfix input-necessary">
            <label for="thing-owner" class="col-xs-3 control-label">联系人</label>
            <div class="col-xs-9">
                <input type="text" name="towner" id="thing-owner" class="form-control" placeholder="联系人">
            </div>
        </div>
        <div class="form-group clearfix input-necessary">
            <label for="thing-tel" class="col-xs-3 control-label">电话</label>
            <div class="col-xs-9">
                <input type="number" name="ttel" id="thing-tel" class="form-control" placeholder="联系电话">
            </div>
        </div>
        <div class="form-group clearfix">
            <label for="thing-qq" class="col-xs-3 control-label">QQ</label>
            <div class="col-xs-9">
                <input type="number" name="tqq" id="thing-qq" class="form-control">
            </div>
        </div>
        <div class="form-group clearfix">
            <label for="thing-peroid" class="col-xs-3 control-label">启示有效期</label>
            <div class="col-xs-9">
                <input type="number" name="tperoid" id="thing-peroid" class="form-control" placeholder="天数">
            </div>
        </div>
        <div class="form-group clearfix">
            <label for="thing-mes" class="col-xs-3 control-label">想说的话</label>
            <div class="col-xs-9">
                <textarea name="tmes" class="form-control" id="thing-mes" rows="5"></textarea>
            </div>
        </div>
        <div class="form-group clearfix center-block submit-button-wrap">
            <button type="submit" name="tsubmit" id="thing-submit" class="btn btn-primary">确认并上传
        </div>
    <?php ActiveForm::end() ?>
</div>